<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.linenumber {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='linenumber'>  1</span> <span class="COMM">/* The MenuTree - use this function to read it:
<span class='linenumber'>  2</span> 
<span class='linenumber'>  3</span> 	function buildTreeFromJSON(myMenu, theTree, Parent)
<span class='linenumber'>  4</span> 	{
<span class='linenumber'>  5</span> 		var i = 0 ;
<span class='linenumber'>  6</span> 		for( var X in myMenu)
<span class='linenumber'>  7</span> 		{  //create a Node for this (Sub)menu
<span class='linenumber'>  8</span>       	           var menuNode = new YAHOO.widget.TextNode(X, Parent, false);
<span class='linenumber'>  9</span> 			for(i=0; i&lt;myMenu[X].length;i++)
<span class='linenumber'> 10</span> 			{				
<span class='linenumber'> 11</span> 				if( null != myMenu[X][i].submenu  )
<span class='linenumber'> 12</span> 				{  //recurse
<span class='linenumber'> 13</span> 				   
<span class='linenumber'> 14</span> 					buildTreeFromJSON(myMenu[X][i].submenu, theTree, menuNode) ;
<span class='linenumber'> 15</span> 				}
<span class='linenumber'> 16</span> 				 var node = new YAHOO.widget.TextNode(myMenu[X][i].text, menuNode, false);          
<span class='linenumber'> 17</span> 			}
<span class='linenumber'> 18</span> 		 }	
<span class='linenumber'> 19</span> 	}
<span class='linenumber'> 20</span> 
<span class='linenumber'> 21</span> 
<span class='linenumber'> 22</span> */</span><span class="WHIT">
<span class='linenumber'> 23</span> 
<span class='linenumber'> 24</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">menuTree</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">"TopLevel1"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">   </span><span class="COMM">// </span><span class="WHIT">
<span class='linenumber'> 25</span> </span><span class="WHIT">                                    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample1"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// First element</span><span class="WHIT">
<span class='linenumber'> 26</span> </span><span class="WHIT">                                      </span><span class="NAME">desc</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample1"</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 27</span> </span><span class="WHIT">                                      </span><span class="NAME">url</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"http://Sample1.com"</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 28</span> </span><span class="WHIT">                                    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">                                    </span><span class="WHIT">
<span class='linenumber'> 29</span> </span><span class="WHIT">                                    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample2"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// Second Element</span><span class="WHIT">
<span class='linenumber'> 30</span> </span><span class="WHIT">                                      </span><span class="NAME">desc</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample2"</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 31</span> </span><span class="WHIT">                                      </span><span class="NAME">url</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"http://Sample2.com"</span><span class="WHIT">
<span class='linenumber'> 32</span> </span><span class="WHIT">                                    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 33</span> 
<span class='linenumber'> 34</span> 
<span class='linenumber'> 35</span> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">submenu</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 36</span> </span><span class="WHIT">     </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">SubLevel1</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'> 37</span> </span><span class="WHIT">           </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 38</span> </span><span class="WHIT">               </span><span class="WHIT">
<span class='linenumber'> 39</span> </span><span class="WHIT">               </span><span class="WHIT">
<span class='linenumber'> 40</span> </span><span class="WHIT">                     </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 41</span> </span><span class="WHIT">                        </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample3"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// First element</span><span class="WHIT">
<span class='linenumber'> 42</span> </span><span class="WHIT">                        </span><span class="NAME">desc</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample3"</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 43</span> </span><span class="WHIT">                        </span><span class="NAME">url</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"http://Sample3.com"</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 44</span> </span><span class="WHIT">                     </span><span class="PUNC">}</span><span class="WHIT">                          </span><span class="WHIT">
<span class='linenumber'> 45</span> </span><span class="WHIT">               </span><span class="WHIT">
<span class='linenumber'> 46</span> </span><span class="WHIT">           </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 47</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'> 48</span> 
<span class='linenumber'> 49</span> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="COMM">//submenu  </span><span class="WHIT">
<span class='linenumber'> 50</span> 
<span class='linenumber'> 51</span> </span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 52</span> </span><span class="WHIT">          </span><span class="WHIT">
<span class='linenumber'> 53</span> </span><span class="WHIT">                          </span><span class="WHIT">
<span class='linenumber'> 54</span> </span><span class="WHIT">                                  </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// End "Home" array.                                  </span><span class="WHIT">
<span class='linenumber'> 55</span> </span><span class="WHIT">                  </span><span class="STRN">"TopLevel2"</span><span class="WHIT">       </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="COMM">// Sales is another array in employees.</span><span class="WHIT">
<span class='linenumber'> 56</span> </span><span class="WHIT">                                    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample4"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// First element</span><span class="WHIT">
<span class='linenumber'> 57</span> </span><span class="WHIT">                                      </span><span class="NAME">desc</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample4"</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 58</span> </span><span class="WHIT">                                      </span><span class="NAME">url</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"http://Sample4.com"</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 59</span> </span><span class="WHIT">                                    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">                                    </span><span class="WHIT">
<span class='linenumber'> 60</span> </span><span class="WHIT">                                    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample5"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// Second Element</span><span class="WHIT">
<span class='linenumber'> 61</span> </span><span class="WHIT">                                      </span><span class="NAME">desc</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Sample5"</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 62</span> </span><span class="WHIT">                                      </span><span class="NAME">url</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"http://Sample5.com"</span><span class="WHIT">
<span class='linenumber'> 63</span> </span><span class="WHIT">                                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 64</span> </span><span class="WHIT">                                  </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="COMM">// End "2112" Array.</span><span class="WHIT">
<span class='linenumber'> 65</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="COMM">// End Menu    </span><span class="WHIT">
<span class='linenumber'> 66</span> 
<span class='linenumber'> 67</span> 
<span class='linenumber'> 68</span> </span></pre></body></html>